//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
#pragma once

#pragma pack(push) 
#pragma pack(1)

#define PKT_AVATAR_CHECK_NAME_ERR_EXISTS				1
#define PKT_AVATAR_CHECK_NAME_ERR_INVALID_SYMBOL		2
#define PKT_AVATAR_CHECK_NAME_ERR_TOO_SHORT				3
#define PKT_AVATAR_CHECK_NAME_ERR_OFFENSIVE				4

//============================================================================
class PktAvatarCheckNameReq : public VxPktHdr
{
public:
	PktAvatarCheckNameReq()
	{
		memset( this, 0, sizeof( PktAvatarCheckNameReq ) );
		m_u16PktLen = sizeof( PktAvatarCheckNameReq );
		m_u16PktType = PKT_TYPE_AVATAR_CHECK_NAME_REQ;
		vx_assert( 0 == ( m_u16PktLen & 0x0f ) );
	}

	//=== vars ===//
	U16		u16Res;		// reserved for alignment
	TCHAR	atcName[ PKT_MAX_AVATAR_NAME_LEN + 1 ];	// char name 
};

//============================================================================
class PktAvatarCheckNameReply : public VxPktHdr
{
public:
	PktAvatarCheckNameReply()
	{
		memset( this, 0, sizeof( PktAvatarCheckNameReply ) );
		m_u16PktLen = sizeof( PktAvatarCheckNameReply );
		m_u16PktType = PKT_TYPE_AVATAR_CHECK_NAME_REPLY;
		vx_assert( 0 == ( m_u16PktLen & 0x0f ) );
	}

	//=== vars ===//
	U16		u16Error;		// error if exists
	TCHAR	atcName[ PKT_MAX_AVATAR_NAME_LEN + 1 ];	// char name 
};

#pragma pack(pop)
